--[[
FilePath: \Lua\View\UISoloBattle\UIJumpShop.lua
1v1随机神秘商店
--]]

require 'View/UIBase/UIBase'

UIJumpShop = UIBase.New(PanelNames.UIJumpShop)
local _M = UIJumpShop

_M.hasInit = false

function _M.Init(func)
    UIBase.Init(_M, func);
end

function _M:OnCreate()
    if not _M.hasInit then
        self.btnClose = self:GetChild("Btn_BgClose");

        _M.hasInit = true

        self:addEvent()
    end
end

function _M:addEvent()
    self.btnClose.onClick:Add(self.onClosePanel,self);
end

function _M:removeEvent()
    self.btnClose.onClick:Remove(self.onClosePanel);
end

-- 显示
function _M:OnEnable()

end

function _M:onClosePanel()
    if self.backFunc ~= nil then
        self.backFunc();
    end
    closeUI(PanelNames.UIJumpShop);
end

-- 隐藏
function _M:OnDisable()

end

-- 卸载
function _M:OnDestroy()
    self:removeEvent();
    self.hasInit = false
end

return _M;